/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package o.exato;

import javax.swing.JInternalFrame;
import javax.swing.UIManager;

/**
 *
 * @author Pedro
 */
public class frmprincipal extends javax.swing.JFrame {

    /**
     * Creates new form frmprincipal
     */
    public frmprincipal() {
           initComponents();
           this.setLocationRelativeTo(null);
           try {
             UIManager.setLookAndFeel( "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
            }
      catch(Exception e)
         {
         }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dppPrincipal = new javax.swing.JDesktopPane();
        mbrMenu = new javax.swing.JMenuBar();
        mnuMatematica = new javax.swing.JMenu();
        mnuFuncao = new javax.swing.JMenu();
        mnuFprimeiro = new javax.swing.JMenu();
        mnuEncoord = new javax.swing.JMenuItem();
        mnuEncleiform = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        mbrMenu.setBorder(null);

        mnuMatematica.setLabel("Matemática");

        mnuFuncao.setLabel("Funções");

        mnuFprimeiro.setLabel("Primeiro Grau");

        mnuEncoord.setText("Encontrar Coordenadas");
        mnuEncoord.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuEncoordActionPerformed(evt);
            }
        });
        mnuFprimeiro.add(mnuEncoord);

        mnuEncleiform.setText("Encontrar Lei de Formação");
        mnuEncleiform.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuEncleiformActionPerformed(evt);
            }
        });
        mnuFprimeiro.add(mnuEncleiform);

        mnuFuncao.add(mnuFprimeiro);

        mnuMatematica.add(mnuFuncao);

        mbrMenu.add(mnuMatematica);

        jMenu1.setText("Física");

        jMenuItem2.setText("Conversor");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        mbrMenu.add(jMenu1);

        setJMenuBar(mbrMenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dppPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(dppPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 461, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 32, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed

        FrmConversor tst=new FrmConversor();
        FrmConversor.jPanel1.setSize(dppPrincipal.size().width, dppPrincipal.size().height);
        dppPrincipal.add(FrmConversor.jPanel1);
        try{frmFPEncoord.pnlEncoord.hide();}
        catch(Exception e){}
        try{frmEncleiform.pnlEncleiform.hide();}
        catch(Exception e){}
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void mnuEncoordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuEncoordActionPerformed
        
        frmFPEncoord ffpec=new frmFPEncoord(); 
        frmFPEncoord.pnlEncoord.setSize(dppPrincipal.size().width, dppPrincipal.size().height);       
        dppPrincipal.add(frmFPEncoord.pnlEncoord);
        try{FrmConversor.jPanel1.hide();}
        catch(Exception e){}
        try{frmEncleiform.pnlEncleiform.hide();}
        catch(Exception e){}
    }//GEN-LAST:event_mnuEncoordActionPerformed

    private void mnuEncleiformActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuEncleiformActionPerformed
        frmEncleiform fecl=new frmEncleiform();
        frmEncleiform.pnlEncleiform.setSize(dppPrincipal.size().width, dppPrincipal.size().height);
        dppPrincipal.add(frmEncleiform.pnlEncleiform);
        try{frmFPEncoord.pnlEncoord.hide();}
        catch(Exception e){}
        try{FrmConversor.jPanel1.hide();}
        catch(Exception e){}
    }//GEN-LAST:event_mnuEncleiformActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frmprincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frmprincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frmprincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frmprincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new frmprincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JDesktopPane dppPrincipal;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuBar mbrMenu;
    private javax.swing.JMenuItem mnuEncleiform;
    private javax.swing.JMenuItem mnuEncoord;
    private javax.swing.JMenu mnuFprimeiro;
    private javax.swing.JMenu mnuFuncao;
    private javax.swing.JMenu mnuMatematica;
    // End of variables declaration//GEN-END:variables
}
